<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:replace="dashboard/header :: header"></head>
<body>

<!--
@desc 权限配置 添加
@author WeiXiaoJin
@since 2020-01-30 07:28:26
-->
	<div layout:fragment="content">
		<div class="container-fluid content-main">
			<div class="animated fadeIn">
				<div class="row">
					<!-- /.col-->
					<div class="col-sm-12">
						<div class="card">
							<div class="card-body">
								<form class="form-horizontal" id="addForm">
<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">是否为调试表，只允许在开发环境使用，测试和线上环境禁用</label>
	<div class="col-md-9">
				<input class="form-control" id="debug" type="text" name="debug" placeholder="是否为调试表，只允许在开发环境使用，测试和线上环境禁用">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">实际表名，例如 apijson_user</label>
	<div class="col-md-9">
				<input class="form-control" id="name" type="text" name="name" placeholder="实际表名，例如 apijson_user">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">外部调用的表别名，例如 User</label>
	<div class="col-md-9">
				<input class="form-control" id="alias" type="text" name="alias" placeholder="外部调用的表别名，例如 User">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 get 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]
用 JSON 类型不能设置默认值，反正权限对应的需求是明确的，也不需要自动转 JSONArray。
TODO: 直接 LOGIN,CONTACT,CIRCLE,OWNER 更简单，反正是开发内部用，不需要复杂查询。</label>
	<div class="col-md-9">
				<input class="form-control" id="get" type="text" name="get" placeholder="允许 get 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]
用 JSON 类型不能设置默认值，反正权限对应的需求是明确的，也不需要自动转 JSONArray。
TODO: 直接 LOGIN,CONTACT,CIRCLE,OWNER 更简单，反正是开发内部用，不需要复杂查询。">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 head 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]</label>
	<div class="col-md-9">
				<input class="form-control" id="head" type="text" name="head" placeholder="允许 head 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 gets 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]</label>
	<div class="col-md-9">
				<input class="form-control" id="gets" type="text" name="gets" placeholder="允许 gets 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 heads 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]</label>
	<div class="col-md-9">
				<input class="form-control" id="heads" type="text" name="heads" placeholder="允许 heads 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 post 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]</label>
	<div class="col-md-9">
				<input class="form-control" id="post" type="text" name="post" placeholder="允许 post 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 put 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]</label>
	<div class="col-md-9">
				<input class="form-control" id="put" type="text" name="put" placeholder="允许 put 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">允许 delete 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]</label>
	<div class="col-md-9">
				<input class="form-control" id="delete" type="text" name="delete" placeholder="允许 delete 的角色列表，例如 ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]">
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">创建时间</label>
	<div class="col-md-9">
				<div class="input-group date">
			<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
			<input type="text" class="form-control time-input" 
			       id="date-3" 
			       name="date" 
			       data-type="datetime" 
			       data-format="yyyy-MM-dd HH:mm:ss" 
			       placeholder="yyyy-MM-dd HH:mm:ss" lay-key="date-3">
		</div>
			</div>
</div>
												<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">httpDelete</label>
	<div class="col-md-9">
				<input class="form-control" id="httpDelete" type="text" name="httpDelete" placeholder="">
			</div>
</div>
																		<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">httpPost</label>
	<div class="col-md-9">
				<input class="form-control" id="httpPost" type="text" name="httpPost" placeholder="">
			</div>
</div>
																		<div class="form-group row">
	<label class="col-md-2 col-form-label control-label" for="text-input">httpPut</label>
	<div class="col-md-9">
				<input class="form-control" id="httpPut" type="text" name="httpPut" placeholder="">
			</div>
</div>
																									</form>
							</div>
						</div>
					</div>
					<!-- /.col-->
				</div>
			</div>
		</div>

	</div>

	<footer th:replace="dashboard/footer :: footer"></footer>

	<script type="text/javascript">
		var addForm = $("#addForm") ; 
		$(function(){
			addForm.validate({
				ignore: [],  
				rules: {
debug: {required:true}
,name: {required:true}
,alias: {required:true}
,get: {required:true}
,head: {required:true}
,gets: {required:true}
,heads: {required:true}
,post: {required:true}
,put: {required:true}
,delete: {required:true}
,date: {required:true,date:true}
,httpDelete: {required:true}
,httpPost: {required:true}
,httpPut: {required:true}
				}
			});
		}) ;

		function submitHandler() {
			var result = $.validate.form("addForm");
			if(result){	
				var saveUrl = ctx+"gateway/admin/gateAccess/save" ;
				$.operate.save(saveUrl , addForm.serialize());
			}
	    }
	</script>

</body>
</html>


